# from collections import deque
# window_size = 100  # 100秒窗口
# time_window = deque(maxlen=window_size)
#
# def update_sliding_window(obj_id):
#     current_time = time.time()
#     time_window.append((current_time, obj_id))
#     # 计算x6（平均间隔）和x7（频次）
#     if len(time_window) > 1:
#         intervals = np.diff([t[0] for t in time_window])
#         x6 = np.mean(intervals)
#         x7 = len(time_window)
#     else:
#         x6, x7 = 0, 0